#ifndef USERSLIST_H
#define USERSLIST_H

#include "user.h"

#include <QObject>
#include <filesystem>
namespace users {
class usersList : public QObject
{
	Q_OBJECT
	std::vector<user> _users;

	using iterator = std::vector<user>::iterator;

	using const_iterator = std::vector<user>::const_iterator;
public:
	usersList(const std::filesystem::path& path,QObject *parent = nullptr);

	iterator begin();

	iterator end();

	const_iterator begin() const;

	const_iterator end() const;

	user& operator[](int index);

	void saveInFile(const std::filesystem::path& path);

	bool empty() const;

public slots:
	void appendUser(const user& user);

};
}

#endif // USERSLIST_H
